﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_CRD_INFO_Get_Card_Info')
	BEGIN
		DROP Procedure usp_UPDMS_CRD_INFO_Get_Card_Info
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_CRD_INFO_Get_Card_Info
**	Desc : 카드의 정보를 조회한다.
**	Test Exec Query : Exec usp_UPDMS_CRD_INFO_Get_Card_Info 'CC07X', 'ko'
**	Called by : Crd_Dac_UPDMS_CRD_INFO.cs
**	Program ID : 카드시스템 전역
**	Auth : 송시명
**	Date : 2011-03-04
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_CRD_INFO_Get_Card_Info]
@ls_card_cd nvarchar(5),
@ls_lang_set nvarchar(2)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

SELECT uci.Seq,
       uci.Card_Cd,
       uci.Card_Nm,
       uci.Card_Num,
       uci.Cvc_Num,
       uci.Valid_Ym,
       uci.Limit_Use,
       uci.Limit_Cash,
       uci.Issue_Co,
       dbo.ufn_UPDMS_Get_Code_Name(uci.Issue_Co, 'CRD', @ls_lang_set) AS Issue_Co_Nm,
       uci.Accnt_Num,
       dbo.ufn_UPDMS_Get_Code_Name(umbai.Bnk_Cd, 'MNY', @ls_lang_set) +' ['+umbai.Accnt_Num+']'  AS Accnt_Nm,
       uci.Use_Yn,
       uci.Attach_File1,
       uci.Attach_File1_Size
  FROM UPDMS_CRD_INFO AS uci WITH(NOLOCK)
  JOIN UPDMS_MNY_BNK_ACCNT_INFO AS umbai WITH(NOLOCK) ON uci.Accnt_Num = umbai.Accnt_Num
 WHERE uci.Card_Cd = @ls_card_cd
 
GO